package com.gdust.hzx.product.controller;

import com.gdust.hzx.product.service.BrandService;
import com.gdust.hzx.model.entity.product.Brand;
import com.gdust.hzx.model.vo.common.Result;
import com.gdust.hzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: BrandController
 * Package: com.gdust.hzx.product.controller
 * Description:
 *
 * @Author syun
 * @Create 2024/12/26 15:33
 * @Version 1.0
 */
@Tag(name="品牌管理接口")
@RestController// @RestController: 专用于restful风格的注解 = @Controller (控制器) + @ResponseBody (方法返回值为json)
@RequestMapping(value = "/api/product/brand")
public class BrandController {
    //注入分类品牌表的service
    @Autowired
    private BrandService brandService;

    @Operation(summary = "获取全部品牌")
    @GetMapping("findAll")
    public Result findAll(){
        //自定义方法：获取全部品牌
       List<Brand> list = brandService.findAll();
        return Result.build(list, ResultCodeEnum.SUCCESS);
    }




}
